package org.ushio.speech_module.speech.audio;

import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @author 陈红
 * 用户录音记录数据访问接口
 * 提供用户录音记录(UserRecording)的CRUD操作及关联查询
 */
@Mapper
public interface UserRecordingMapper {

    int insertUserRecording(UserRecording userRecording);

    void updateUserRecording(UserRecording userRecording);

    UserRecording getUserRecordingByUserIdAndSentenceId(Long userId, Long sentenceId);

    List<UserRecording> getUserRecordingByUserId(Long userId);

    // 用于根据 chapterId 获取用户录音记录
    List<UserRecording> getUserRecordingsByChapterId(Long chapterId);

    // 用于根据 chapterId 和 userId 获取用户录音记录
    List<UserRecording> getUserRecordingByUserIdAndChapterId(Map<String, Long> params);

    // 用于获取序列值
    Long getRecordingSequence();
}
